class Effect {

	/**************************** 淡入效果 ****************************/

	static fadeIn(container: egret.DisplayObjectContainer, parent: egret.DisplayObjectContainer) {
		parent.addChild(container);
		container.alpha = 0;
		egret.Tween.get(container).to({alpha: 1}, 500);
	}


	/**************************** 淡出效果 ****************************/

	static fadeOut(container: egret.DisplayObjectContainer, parent: egret.DisplayObjectContainer) {
		egret.Tween.get(container).to({alpha: 0}, 500).call(() => {
			parent.removeChild(container);
		});
	}


	/**************************** 弹入效果 ****************************/

	static bounceIn(container: egret.DisplayObjectContainer, parent: egret.DisplayObjectContainer) {
		parent.addChild(container);
		container.alpha = 0;
		container.scaleX = 0;
		container.scaleY = 0;
		egret.Tween.get(container)
			.to({scaleX: 1.15, scaleY: 1.15, alpha: 1}, 150)
			.to({scaleX: 1, scaleY: 1}, 100);
	}


	/**************************** 弹出效果 ****************************/

	static bounceOut(container: egret.DisplayObjectContainer, parent: egret.DisplayObjectContainer) {
		egret.Tween.get(container)
			.to({scaleX: 1.15, scaleY: 1.15}, 100)
			.to({scaleX: 0, scaleY: 0, alpha: 0}, 150)
			.call(() => {
			parent.removeChild(container);
		});
	}


	/**************************** 右滑入效果 ****************************/

	static slideRightIn(container: egret.DisplayObjectContainer, parent: egret.DisplayObjectContainer) {
		let pos = parent instanceof egret.Stage ? parent.stageWidth : parent.width;
		// let shadow = new egret.DropShadowFilter(8, 180, 0x000000, 0.25, 12);
		parent.addChild(container);
		container.x = pos;
		// container.filters = [shadow];
		egret.Tween.get(container).to({x: 0}, 1000).call(() => {
			// container.filters = [];
		});
	}

	/**************************** 右左滑出效果 ****************************/

	static slideRightOut(container: egret.DisplayObjectContainer, parent: egret.DisplayObjectContainer) {
		let pos = parent instanceof egret.Stage ? parent.stageWidth / 2 * -1 : parent.width / 2 * -1;
		egret.Tween.get(container).to({x: pos}, 1000).call(() => {
			parent.removeChild(container);
		});
	}
}